<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../css/index.css" />
		<style>
			html,
			body {
				width: 100%;
				height: 100%;
				background: #ececec;
			}
			
			#app {
				width: 100%;
				height: 100%;
				display: flex;
				flex-direction: column;
			}
			
			header {
				width: 100%;
				height: 46px;
			}
			
			section {
				flex: 1;
				overflow-y: scroll;
			}
			
			.van-nav-bar {
				background-color: #ff5c00;
			}
			.van-nav-bar .van-icon{
				color: #fbe9e9;
			}
			.van-nav-bar__title{
				color: #fefaea;
			}
			.success-pay{
				padding-top: 50px;
				text-align: center;
				width: 100%;
				height: 18%;
				background: #ff5c00;
				color: #fefaea;
			}
		</style>
	</head>
	<body>
		<div id="app">
			<header>
				<van-nav-bar title="支付成功" left-arrow @click-left="onClickLeft"/>
			</header>
			<section>
				<div class="success-pay">
					<van-icon class="success-icon" name="success" size="50px" color="#fefaea"></van-icon>
					<div>支付成功</div>
				</div>
				<div class="goods-data">
					<van-row>
						<van-col span="24" style="color: #FF5C00;background-color: white;text-align: center;padding-top: 20px;padding-bottom: 5px;">
							<van-icon color="red" name="like"></van-icon>
							<span style="position: relative;top: -3px;">你可能还喜欢</span>
						</van-col>
					</van-row>
					<van-row style="background-color: white;">
						<van-col v-for="(u,i) in Goods" span="24" style="margin:10px 0px">
							<van-card
							  v-bind:price="u.RealPrice"
							  v-bind:title="u.Name"
							  v-bind:origin-price="u.MarketPrice"
							  id="u.Id"
							  @click="GetId(i)"
							>
							<img v-bind:src="u.GoodsImageUrl.src" onerror="javascript:this.src='../../img/insert.png'; "  slot="thumb">
							<div slot="tags" style="position: relative;top:60px">累计销售{{u.VirtualSaleCount}}</div>
							<div slot="footer">{{u.BrowseCount}}浏览</div>
							</van-card>
						</van-col>
					</van-row>
				</div>
			</section>
		</div>
		<script src="../../js/vue.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/vant.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/vue-lazyload.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/ajax.js" type="text/javascript" charset="utf-8"></script>
		<script src="html5plus://ready"></script>
		<script type="text/javascript">
			var vm =new Vue({
				el:"#app",
				data:{
					Goods:"",
					price:JSON.stringify(localStorage.getItem("payprice")),
					orderId:"",
				},
				methods:{
					back(){			
						var wv = plus.webview.currentWebview();
						plus.webview.close(wv.id);
					},
					onClickLeft:function(){
						plus.webview.close(plus.webview.currentWebview());
						// plus.webview.open("../../index.html");//返回主页
					},
					GetId:function(res){
						var w=plus.webview.create("../Getails/goods.html","vm.Goods[res].Id",{
							zindex:2
						},{GoodsId:vm.Goods[res].Id});
						plus.webview.show("vm.Goods[res].Id");
					},
				},
				mounted:function() {
					var _this=this;
					ajax({
						type:"post",
						url:"http://dsapi.ysd3g.com/api/IndexGoodsData",
						dataType:"JSONP",
						success:function(res){
							console.log(res.Data);
							vm.Goods=res.Data;
						}
					});
					plus.key.addEventListener("backbutton",function(){  
						var wv = plus.webview.currentWebview();
						plus.webview.close(wv.id);
					}); 
					_this.orderId=plus.webview.currentWebview().orderId;
				}
			})
			var curr=plus.webview.currentWebview();
			vm.price=curr.price;
		</script>
	</body>
</html>
